home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / hyperspt.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  26KB  |  743 lines

  1. /***************************************************************************
  2.  
  3. Based on drivers from Juno First emulator by Chris Hardy (chrish@kcbbs.gen.nz)
  4.  
  5. ***************************************************************************/
  6.  
  7. #include "driver.h"
  8. #include "vidhrdw/generic.h"
  9. #include "cpu/m6809/m6809.h"
  10.  
  11.  
  12. void konami1_decode(void);
  13.  
  14. extern unsigned char *hyperspt_scroll;
  15.  
  16. WRITE_HANDLER( hyperspt_flipscreen_w );
  17. void hyperspt_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  18. int hyperspt_vh_start(void);
  19. void hyperspt_vh_stop(void);
  20. void hyperspt_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  21. void roadf_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  22.  
  23. WRITE_HANDLER( konami_sh_irqtrigger_w );
  24. READ_HANDLER( hyperspt_sh_timer_r );
  25. WRITE_HANDLER( hyperspt_sound_w );
  26.  
  27. /* these routines lurk in sndhrdw/trackfld.c */
  28. extern struct VLM5030interface konami_vlm5030_interface;
  29. extern struct SN76496interface konami_sn76496_interface;
  30. extern struct DACinterface konami_dac_interface;
  31. WRITE_HANDLER( konami_SN76496_latch_w );
  32. WRITE_HANDLER( konami_SN76496_0_w );
  33.  
  34.  
  35. /* handle fake button for speed cheat */
  36. static READ_HANDLER( konami_IN1_r )
  37. {
  38.     int res;
  39.     static int cheat = 0;
  40.     static int bits[] = { 0xee, 0xff, 0xbb, 0xaa };
  41.  
  42.     res = readinputport(1);
  43.  
  44.     if ((res & 0x80) == 0)
  45.     {
  46.         res |= 0x55;
  47.         res &= bits[cheat];
  48.         cheat = (++cheat)%4;
  49.     }
  50.     return res;
  51. }
  52.  
  53.  
  54.  
  55. /*
  56.  Track'n'Field has 1k of battery backed RAM which can be erased by setting a dipswitch
  57. */
  58. static unsigned char *nvram;
  59. static size_t nvram_size;
  60. static int we_flipped_the_switch;
  61.  
  62. static void nvram_handler(void *file,int read_or_write)
  63. {
  64.     if (read_or_write)
  65.     {
  66.         osd_fwrite(file,nvram,nvram_size);
  67.  
  68.         if (we_flipped_the_switch)
  69.         {
  70.             struct InputPort *in;
  71.  
  72.  
  73.             /* find the dip switch which resets the high score table, and set it */
  74.             /* back to off. */
  75.             in = Machine->input_ports;
  76.  
  77.             while (in->type != IPT_END)
  78.             {
  79.                 if (in->name != NULL && in->name != IP_NAME_DEFAULT &&
  80.                         strcmp(in->name,"World Records") == 0)
  81.                 {
  82.                     if (in->default_value == 0)
  83.                         in->default_value = in->mask;
  84.                     break;
  85.                 }
  86.  
  87.                 in++;
  88.             }
  89.  
  90.             we_flipped_the_switch = 0;
  91.         }
  92.     }
  93.     else
  94.     {
  95.         if (file)
  96.         {
  97.             osd_fread(file,nvram,nvram_size);
  98.             we_flipped_the_switch = 0;
  99.         }
  100.         else
  101.         {
  102.             struct InputPort *in;
  103.  
  104.  
  105.             /* find the dip switch which resets the high score table, and set it on */
  106.             in = Machine->input_ports;
  107.  
  108.             while (in->type != IPT_END)
  109.             {
  110.                 if (in->name != NULL && in->name != IP_NAME_DEFAULT &&
  111.                         strcmp(in->name,"World Records") == 0)
  112.                 {
  113.                     if (in->default_value == in->mask)
  114.                     {
  115.                         in->default_value = 0;
  116.                         we_flipped_the_switch = 1;
  117.                     }
  118.                     break;
  119.                 }
  120.  
  121.                 in++;
  122.             }
  123.         }
  124.     }
  125. }
  126.  
  127.  
  128.  
  129. static struct MemoryReadAddress hyperspt_readmem[] =
  130. {
  131.     { 0x1000, 0x10ff, MRA_RAM },
  132.     { 0x1600, 0x1600, input_port_4_r }, /* DIP 2 */
  133.     { 0x1680, 0x1680, input_port_0_r }, /* IO Coin */
  134. //    { 0x1681, 0x1681, input_port_1_r }, /* P1 IO */
  135.     { 0x1681, 0x1681, konami_IN1_r }, /* P1 IO and handle fake button for cheating */
  136.     { 0x1682, 0x1682, input_port_2_r }, /* P2 IO */
  137.     { 0x1683, 0x1683, input_port_3_r }, /* DIP 1 */
  138.     { 0x2000, 0x3fff, MRA_RAM },
  139.     { 0x4000, 0xffff, MRA_ROM },
  140.     { -1 }  /* end of table */
  141. };
  142.  
  143. static struct MemoryReadAddress roadf_readmem[] =
  144. {
  145.     { 0x1000, 0x10ff, MRA_RAM },
  146.     { 0x1600, 0x1600, input_port_4_r }, /* DIP 2 */
  147.     { 0x1680, 0x1680, input_port_0_r }, /* IO Coin */
  148.     { 0x1681, 0x1681, input_port_1_r }, /* P1 IO */
  149.     { 0x1682, 0x1682, input_port_2_r }, /* P2 IO */
  150.     { 0x1683, 0x1683, input_port_3_r }, /* DIP 1 */
  151.     { 0x2000, 0x3fff, MRA_RAM },
  152.     { 0x4000, 0xffff, MRA_ROM },
  153.     { -1 }  /* end of table */
  154. };
  155.  
  156. static struct MemoryWriteAddress writemem[] =
  157. {
  158.     { 0x1000, 0x10bf, MWA_RAM, &spriteram, &spriteram_size },
  159.     { 0x10C0, 0x10ff, MWA_RAM, &hyperspt_scroll },  /* Scroll amount */
  160.     { 0x1400, 0x1400, watchdog_reset_w },
  161.     { 0x1480, 0x1480, hyperspt_flipscreen_w },
  162.     { 0x1481, 0x1481, konami_sh_irqtrigger_w },  /* cause interrupt on audio CPU */
  163.     { 0x1483, 0x1484, coin_counter_w },
  164.     { 0x1487, 0x1487, interrupt_enable_w },  /* Interrupt enable */
  165.     { 0x1500, 0x1500, soundlatch_w },
  166.     { 0x2000, 0x27ff, videoram_w, &videoram, &videoram_size },
  167.     { 0x2800, 0x2fff, colorram_w, &colorram },
  168.     { 0x3000, 0x37ff, MWA_RAM },
  169.     { 0x3800, 0x3fff, MWA_RAM, &nvram, &nvram_size },
  170.     { 0x4000, 0xffff, MWA_ROM },
  171.     { -1 }  /* end of table */
  172. };
  173.  
  174. static struct MemoryReadAddress sound_readmem[] =
  175. {
  176.     { 0x0000, 0x3fff, MRA_ROM },
  177.     { 0x4000, 0x4fff, MRA_RAM },
  178.     { 0x6000, 0x6000, soundlatch_r },
  179.     { 0x8000, 0x8000, hyperspt_sh_timer_r },
  180.     { -1 }    /* end of table */
  181. };
  182.  
  183. static struct MemoryWriteAddress sound_writemem[] =
  184. {
  185.     { 0x0000, 0x3fff, MWA_ROM },
  186.     { 0x4000, 0x4fff, MWA_RAM },
  187.     { 0xa000, 0xa000, VLM5030_data_w }, /* speech data */
  188.     { 0xc000, 0xdfff, hyperspt_sound_w },     /* speech and output controll */
  189.     { 0xe000, 0xe000, DAC_0_data_w },
  190.     { 0xe001, 0xe001, konami_SN76496_latch_w },  /* Loads the snd command into the snd latch */
  191.     { 0xe002, 0xe002, konami_SN76496_0_w },      /* This address triggers the SN chip to read the data port. */
  192.     { -1 }    /* end of table */
  193. };
  194.  
  195.  
  196.  
  197. INPUT_PORTS_START( hyperspt )
  198.     PORT_START      /* IN0 */
  199.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  200.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  201.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  202.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  203.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  204.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 )
  205.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  206.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  207.  
  208.     PORT_START      /* IN1 */
  209.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER1 )
  210.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER1 )
  211.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER1 )
  212.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START3 )
  213.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER2 )
  214.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER2 )
  215.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER2 )
  216. //    PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  217.     /* Fake button to press buttons 1 and 3 impossibly fast. Handle via konami_IN1_r */
  218.     PORT_BITX(0x80, IP_ACTIVE_LOW, IPT_BUTTON4 | IPF_CHEAT | IPF_PLAYER1, "Run Like Hell Cheat", IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  219.  
  220.     PORT_START      /* IN2 */
  221.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER3 /*| IPF_COCKTAIL*/ )
  222.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER3 /*| IPF_COCKTAIL*/ )
  223.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER3 /*| IPF_COCKTAIL*/ )
  224.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START4 )
  225.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON3 | IPF_PLAYER4 /*| IPF_COCKTAIL*/ )
  226.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_PLAYER4 /*| IPF_COCKTAIL*/ )
  227.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_PLAYER4 /*| IPF_COCKTAIL*/ )
  228.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  229.  
  230.     PORT_START      /* DSW0 */
  231.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  232.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  233.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  234.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  235.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  236.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  237.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  238.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  239.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  240.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  241.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  242.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  243.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  244.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  245.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  246.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  247.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  248.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  249.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  250.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  251.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  252.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  253.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  254.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  255.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  256.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  257.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  258.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  259.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  260.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  261.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  262.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  263.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  264.     PORT_DIPSETTING(    0x00, "Disabled" )
  265. /* 0x00 disables Coin 2. It still accepts coins and makes the sound, but
  266.    it doesn't give you any credit */
  267.  
  268.     PORT_START      /* DSW1 */
  269.     PORT_DIPNAME( 0x01, 0x00, "After Last Event" )
  270.     PORT_DIPSETTING(    0x01, "Game Over" )
  271.     PORT_DIPSETTING(    0x00, "Game Continues" )
  272.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Cabinet ) )
  273.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  274.     PORT_DIPSETTING(    0x02, DEF_STR( Cocktail ) )
  275.     PORT_DIPNAME( 0x04, 0x00, DEF_STR( Demo_Sounds ) )
  276.     PORT_DIPSETTING(    0x04, DEF_STR( Off ) )
  277.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  278.     PORT_DIPNAME( 0x08, 0x08, "World Records" )
  279.     PORT_DIPSETTING(    0x08, "Don't Erase" )
  280.     PORT_DIPSETTING(    0x00, "Erase on Reset" )
  281.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Difficulty ) )
  282.     PORT_DIPSETTING(    0xf0, "Easy 1" )
  283.     PORT_DIPSETTING(    0xe0, "Easy 2" )
  284.     PORT_DIPSETTING(    0xd0, "Easy 3" )
  285.     PORT_DIPSETTING(    0xc0, "Easy 4" )
  286.     PORT_DIPSETTING(    0xb0, "Normal 1" )
  287.     PORT_DIPSETTING(    0xa0, "Normal 2" )
  288.     PORT_DIPSETTING(    0x90, "Normal 3" )
  289.     PORT_DIPSETTING(    0x80, "Normal 4" )
  290.     PORT_DIPSETTING(    0x70, "Normal 5" )
  291.     PORT_DIPSETTING(    0x60, "Normal 6" )
  292.     PORT_DIPSETTING(    0x50, "Normal 7" )
  293.     PORT_DIPSETTING(    0x40, "Normal 8" )
  294.     PORT_DIPSETTING(    0x30, "Difficult 1" )
  295.     PORT_DIPSETTING(    0x20, "Difficult 2" )
  296.     PORT_DIPSETTING(    0x10, "Difficult 3" )
  297.     PORT_DIPSETTING(    0x00, "Difficult 4" )
  298. INPUT_PORTS_END
  299.  
  300. INPUT_PORTS_START( roadf )
  301.     PORT_START      /* IN0 */
  302.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 )
  303.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_COIN2 )
  304.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN3 )
  305.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_START1 )
  306.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START2 )
  307.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN4 )
  308.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  309.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  310.  
  311.     PORT_START      /* IN1 */
  312.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY )
  313.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY )
  314.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY )
  315.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY )
  316.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 )
  317.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 )
  318.     PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN )
  319.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  320.  
  321.     PORT_START      /* IN2 */
  322.     PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT | IPF_8WAY | IPF_COCKTAIL )
  323.     PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT | IPF_8WAY | IPF_COCKTAIL )
  324.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_JOYSTICK_UP | IPF_8WAY | IPF_COCKTAIL )
  325.     PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN | IPF_8WAY | IPF_COCKTAIL )
  326.     PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_BUTTON1 | IPF_COCKTAIL )
  327.     PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_BUTTON2 | IPF_COCKTAIL )
  328.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN )    /* the game doesn't boot if this is 1 */
  329.     PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN )
  330.  
  331.     PORT_START      /* DSW0 */
  332.     PORT_DIPNAME( 0x0f, 0x0f, DEF_STR( Coin_A ) )
  333.     PORT_DIPSETTING(    0x02, DEF_STR( 4C_1C ) )
  334.     PORT_DIPSETTING(    0x05, DEF_STR( 3C_1C ) )
  335.     PORT_DIPSETTING(    0x08, DEF_STR( 2C_1C ) )
  336.     PORT_DIPSETTING(    0x04, DEF_STR( 3C_2C ) )
  337.     PORT_DIPSETTING(    0x01, DEF_STR( 4C_3C ) )
  338.     PORT_DIPSETTING(    0x0f, DEF_STR( 1C_1C ) )
  339.     PORT_DIPSETTING(    0x03, DEF_STR( 3C_4C ) )
  340.     PORT_DIPSETTING(    0x07, DEF_STR( 2C_3C ) )
  341.     PORT_DIPSETTING(    0x0e, DEF_STR( 1C_2C ) )
  342.     PORT_DIPSETTING(    0x06, DEF_STR( 2C_5C ) )
  343.     PORT_DIPSETTING(    0x0d, DEF_STR( 1C_3C ) )
  344.     PORT_DIPSETTING(    0x0c, DEF_STR( 1C_4C ) )
  345.     PORT_DIPSETTING(    0x0b, DEF_STR( 1C_5C ) )
  346.     PORT_DIPSETTING(    0x0a, DEF_STR( 1C_6C ) )
  347.     PORT_DIPSETTING(    0x09, DEF_STR( 1C_7C ) )
  348.     PORT_DIPSETTING(    0x00, DEF_STR( Free_Play ) )
  349.     PORT_DIPNAME( 0xf0, 0xf0, DEF_STR( Coin_B ) )
  350.     PORT_DIPSETTING(    0x20, DEF_STR( 4C_1C ) )
  351.     PORT_DIPSETTING(    0x50, DEF_STR( 3C_1C ) )
  352.     PORT_DIPSETTING(    0x80, DEF_STR( 2C_1C ) )
  353.     PORT_DIPSETTING(    0x40, DEF_STR( 3C_2C ) )
  354.     PORT_DIPSETTING(    0x10, DEF_STR( 4C_3C ) )
  355.     PORT_DIPSETTING(    0xf0, DEF_STR( 1C_1C ) )
  356.     PORT_DIPSETTING(    0x30, DEF_STR( 3C_4C ) )
  357.     PORT_DIPSETTING(    0x70, DEF_STR( 2C_3C ) )
  358.     PORT_DIPSETTING(    0xe0, DEF_STR( 1C_2C ) )
  359.     PORT_DIPSETTING(    0x60, DEF_STR( 2C_5C ) )
  360.     PORT_DIPSETTING(    0xd0, DEF_STR( 1C_3C ) )
  361.     PORT_DIPSETTING(    0xc0, DEF_STR( 1C_4C ) )
  362.     PORT_DIPSETTING(    0xb0, DEF_STR( 1C_5C ) )
  363.     PORT_DIPSETTING(    0xa0, DEF_STR( 1C_6C ) )
  364.     PORT_DIPSETTING(    0x90, DEF_STR( 1C_7C ) )
  365.     PORT_DIPSETTING(    0x00, "Disabled" )
  366. /* 0x00 disables Coin 2. It still accepts coins and makes the sound, but
  367.    it doesn't give you any credit */
  368.  
  369.     PORT_START      /* DSW1 */
  370.     PORT_DIPNAME( 0x01, 0x00, "Allow Continue" )
  371.     PORT_DIPSETTING(    0x01, DEF_STR( No ) )
  372.     PORT_DIPSETTING(    0x00, DEF_STR( Yes ) )
  373.     PORT_DIPNAME( 0x06, 0x06, "Number of Opponents" )
  374.     PORT_DIPSETTING(    0x06, "Easy" )
  375.     PORT_DIPSETTING(    0x04, "Medium" )
  376.     PORT_DIPSETTING(    0x02, "Hard" )
  377.     PORT_DIPSETTING(    0x00, "Hardest" )
  378.     PORT_DIPNAME( 0x08, 0x08, "Speed of Opponents" )
  379.     PORT_DIPSETTING(    0x08, "Easy" )
  380.     PORT_DIPSETTING(    0x00, "Difficult" )
  381.     PORT_DIPNAME( 0x30, 0x30, "Fuel Consumption" )
  382.     PORT_DIPSETTING(    0x30, "Easy" )
  383.     PORT_DIPSETTING(    0x20, "Medium" )
  384.     PORT_DIPSETTING(    0x10, "Hard" )
  385.     PORT_DIPSETTING(    0x00, "Hardest" )
  386.     PORT_DIPNAME( 0x40, 0x00, DEF_STR( Cabinet ) )
  387.     PORT_DIPSETTING(    0x00, DEF_STR( Upright ) )
  388.     PORT_DIPSETTING(    0x40, DEF_STR( Cocktail ) )
  389.     PORT_DIPNAME( 0x80, 0x00, DEF_STR( Demo_Sounds ) )
  390.     PORT_DIPSETTING(    0x80, DEF_STR( Off ) )
  391.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  392. INPUT_PORTS_END
  393.  
  394.  
  395.  
  396. static struct GfxLayout hyperspt_charlayout =
  397. {
  398.     8,8,    /* 8*8 sprites */
  399.     1024,    /* 1024 characters */
  400.     4,    /* 4 bits per pixel */
  401.     { 0x4000*8+4, 0x4000*8+0, 4, 0  },
  402.     { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3 },
  403.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  404.     16*8    /* every sprite takes 64 consecutive bytes */
  405. };
  406.  
  407. static struct GfxLayout hyperspt_spritelayout =
  408. {
  409.     16,16,    /* 16*16 sprites */
  410.     512,    /* 512 sprites */
  411.     4,    /* 4 bits per pixel */
  412.     { 0x8000*8+4, 0x8000*8+0, 4, 0 },
  413.     { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3,
  414.             16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 },
  415.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,
  416.         32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8, },
  417.     64*8    /* every sprite takes 64 consecutive bytes */
  418. };
  419.  
  420. static struct GfxDecodeInfo hyperspt_gfxdecodeinfo[] =
  421. {
  422.     { REGION_GFX1, 0, &hyperspt_charlayout,       0, 16 },
  423.     { REGION_GFX2, 0, &hyperspt_spritelayout, 16*16, 16 },
  424.     { -1 } /* end of array */
  425. };
  426.  
  427.  
  428. static struct GfxLayout roadf_charlayout =
  429. {
  430.     8,8,    /* 8*8 sprites */
  431.     1536,    /* 1536 characters */
  432.     4,    /* 4 bits per pixel */
  433.     { 0x6000*8+4, 0x6000*8+0, 4, 0  },
  434.     { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3 },
  435.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  436.     16*8    /* every sprite takes 64 consecutive bytes */
  437. };
  438.  
  439. static struct GfxLayout roadf_spritelayout =
  440. {
  441.     16,16,    /* 16*16 sprites */
  442.     256,    /* 256 sprites */
  443.     4,    /* 4 bits per pixel */
  444.     { 0x4000*8+4, 0x4000*8+0, 4, 0 },
  445.     { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3,
  446.             16*8+0, 16*8+1, 16*8+2, 16*8+3, 24*8+0, 24*8+1, 24*8+2, 24*8+3 },
  447.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 ,
  448.         32*8, 33*8, 34*8, 35*8, 36*8, 37*8, 38*8, 39*8, },
  449.     64*8    /* every sprite takes 64 consecutive bytes */
  450. };
  451.  
  452. static struct GfxDecodeInfo roadf_gfxdecodeinfo[] =
  453. {
  454.     { REGION_GFX1, 0, &roadf_charlayout,       0, 16 },
  455.     { REGION_GFX2, 0, &roadf_spritelayout, 16*16, 16 },
  456.     { -1 } /* end of array */
  457. };
  458.  
  459.  
  460.  
  461. /* filename for hyper sports sample files */
  462. static const char *hyperspt_sample_names[] =
  463. {
  464.     "*hyperspt",
  465.     "00.wav","01.wav","02.wav","03.wav","04.wav","05.wav","06.wav","07.wav",
  466.     "08.wav","09.wav","0a.wav","0b.wav","0c.wav","0d.wav","0e.wav","0f.wav",
  467.     "10.wav","11.wav","12.wav","13.wav","14.wav","15.wav","16.wav","17.wav",
  468.     "18.wav","19.wav","1a.wav","1b.wav","1c.wav","1d.wav","1e.wav","1f.wav",
  469.     "20.wav","21.wav","22.wav","23.wav","24.wav","25.wav","26.wav","27.wav",
  470.     "28.wav","29.wav","2a.wav","2b.wav","2c.wav","2d.wav","2e.wav","2f.wav",
  471.     "30.wav","31.wav","32.wav","33.wav","34.wav","35.wav","36.wav","37.wav",
  472.     "38.wav","39.wav","3a.wav","3b.wav","3c.wav","3d.wav","3e.wav","3f.wav",
  473.     "40.wav","41.wav","42.wav","43.wav","44.wav","45.wav","46.wav","47.wav",
  474.     "48.wav","49.wav",
  475.     0
  476. };
  477.  
  478. struct VLM5030interface hyperspt_vlm5030_interface =
  479. {
  480.     3580000,    /* master clock  */
  481.     255,        /* volume        */
  482.     REGION_SOUND1,    /* memory region  */
  483.     0,         /* memory size    */
  484.     0,         /* VCU            */
  485.     hyperspt_sample_names
  486. };
  487.  
  488.  
  489. static struct MachineDriver machine_driver_hyperspt =
  490. {
  491.     /* basic machine hardware */
  492.     {
  493.         {
  494.             CPU_M6809,
  495.             2048000,        /* 1.400 Mhz ??? */
  496.             hyperspt_readmem,writemem,0,0,
  497.             interrupt,1
  498.         },
  499.         {
  500.             CPU_Z80 | CPU_AUDIO_CPU,
  501.             14318180/4,    /* Z80 Clock is derived from a 14.31818 Mhz crystal */
  502.             sound_readmem,sound_writemem,0,0,
  503.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  504.         }
  505.     },
  506.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  507.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  508.     0,
  509.  
  510.     /* video hardware */
  511.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  512.     hyperspt_gfxdecodeinfo,
  513.     32,16*16+16*16,
  514.     hyperspt_vh_convert_color_prom,
  515.  
  516.     VIDEO_TYPE_RASTER,
  517.     0,
  518.     hyperspt_vh_start,
  519.     hyperspt_vh_stop,
  520.     hyperspt_vh_screenrefresh,
  521.  
  522.     /* sound hardware */
  523.     0,0,0,0,
  524.     {
  525.         {
  526.             SOUND_DAC,
  527.             &konami_dac_interface
  528.         },
  529.         {
  530.             SOUND_SN76496,
  531.             &konami_sn76496_interface
  532.         },
  533.         {
  534.             SOUND_VLM5030,
  535.             &hyperspt_vlm5030_interface
  536.         }
  537.     },
  538.  
  539.     nvram_handler
  540. };
  541.  
  542. static struct MachineDriver machine_driver_roadf =
  543. {
  544.     /* basic machine hardware */
  545.     {
  546.         {
  547.             CPU_M6809,
  548.             2048000,        /* 1.400 Mhz ??? */
  549.             roadf_readmem,writemem,0,0,
  550.             interrupt,1
  551.         },
  552.         {
  553.             CPU_Z80 | CPU_AUDIO_CPU,
  554.             14318180/4,    /* Z80 Clock is derived from a 14.31818 Mhz crystal */
  555.             sound_readmem,sound_writemem,0,0,
  556.             ignore_interrupt,1    /* interrupts are triggered by the main CPU */
  557.         }
  558.     },
  559.     60, DEFAULT_60HZ_VBLANK_DURATION,    /* frames per second, vblank duration */
  560.     1,    /* 1 CPU slice per frame - interleaving is forced when a sound command is written */
  561.     0,
  562.  
  563.     /* video hardware */
  564.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  565.     roadf_gfxdecodeinfo,
  566.     32,16*16+16*16,
  567.     hyperspt_vh_convert_color_prom,
  568.  
  569.     VIDEO_TYPE_RASTER,
  570.     0,
  571.     hyperspt_vh_start,
  572.     hyperspt_vh_stop,
  573.     roadf_vh_screenrefresh,
  574.  
  575.     /* sound hardware */
  576.     0,0,0,0,
  577.     {
  578.         {
  579.             SOUND_DAC,
  580.             &konami_dac_interface
  581.         },
  582.         {
  583.             SOUND_SN76496,
  584.             &konami_sn76496_interface
  585.         },
  586.         {
  587.             SOUND_VLM5030,
  588.             &konami_vlm5030_interface
  589.         }
  590.     }
  591. };
  592.  
  593.  
  594. /***************************************************************************
  595.  
  596.   Game driver(s)
  597.  
  598. ***************************************************************************/
  599.  
  600. ROM_START( hyperspt )
  601.     ROM_REGION( 2*0x10000, REGION_CPU1 )     /* 64k for code + 64k for decrypted opcodes */
  602.     ROM_LOAD( "c01",          0x4000, 0x2000, 0x0c720eeb )
  603.     ROM_LOAD( "c02",          0x6000, 0x2000, 0x560258e0 )
  604.     ROM_LOAD( "c03",          0x8000, 0x2000, 0x9b01c7e6 )
  605.     ROM_LOAD( "c04",          0xa000, 0x2000, 0x10d7e9a2 )
  606.     ROM_LOAD( "c05",          0xc000, 0x2000, 0xb105a8cd )
  607.     ROM_LOAD( "c06",          0xe000, 0x2000, 0x1a34a849 )
  608.  
  609.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  610.     ROM_LOAD( "c10",          0x0000, 0x2000, 0x3dc1a6ff )
  611.     ROM_LOAD( "c09",          0x2000, 0x2000, 0x9b525c3e )
  612.  
  613.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  614.     ROM_LOAD( "c26",          0x00000, 0x2000, 0xa6897eac )
  615.     ROM_LOAD( "c24",          0x02000, 0x2000, 0x5fb230c0 )
  616.     ROM_LOAD( "c22",          0x04000, 0x2000, 0xed9271a0 )
  617.     ROM_LOAD( "c20",          0x06000, 0x2000, 0x183f4324 )
  618.  
  619.     ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  620.     ROM_LOAD( "c14",          0x00000, 0x2000, 0xc72d63be )
  621.     ROM_LOAD( "c13",          0x02000, 0x2000, 0x76565608 )
  622.     ROM_LOAD( "c12",          0x04000, 0x2000, 0x74d2cc69 )
  623.     ROM_LOAD( "c11",          0x06000, 0x2000, 0x66cbcb4d )
  624.     ROM_LOAD( "c18",          0x08000, 0x2000, 0xed25e669 )
  625.     ROM_LOAD( "c17",          0x0a000, 0x2000, 0xb145b39f )
  626.     ROM_LOAD( "c16",          0x0c000, 0x2000, 0xd7ff9f2b )
  627.     ROM_LOAD( "c15",          0x0e000, 0x2000, 0xf3d454e6 )
  628.  
  629.     ROM_REGION( 0x0220, REGION_PROMS )
  630.     ROM_LOAD( "c03_c27.bin",  0x0000, 0x0020, 0xbc8a5956 )
  631.     ROM_LOAD( "j12_c28.bin",  0x0020, 0x0100, 0x2c891d59 )
  632.     ROM_LOAD( "a09_c29.bin",  0x0120, 0x0100, 0x811a3f3f )
  633.  
  634.     ROM_REGION( 0x10000, REGION_SOUND1 )    /*  64k for speech rom    */
  635.     ROM_LOAD( "c08",          0x0000, 0x2000, 0xe8f8ea78 )
  636. ROM_END
  637.  
  638. ROM_START( hpolym84 )
  639.     ROM_REGION( 2*0x10000, REGION_CPU1 )     /* 64k for code + 64k for decrypted opcodes */
  640.     ROM_LOAD( "c01",          0x4000, 0x2000, 0x0c720eeb )
  641.     ROM_LOAD( "c02",          0x6000, 0x2000, 0x560258e0 )
  642.     ROM_LOAD( "c03",          0x8000, 0x2000, 0x9b01c7e6 )
  643.     ROM_LOAD( "330e04.bin",   0xa000, 0x2000, 0x9c5e2934 )
  644.     ROM_LOAD( "c05",          0xc000, 0x2000, 0xb105a8cd )
  645.     ROM_LOAD( "c06",          0xe000, 0x2000, 0x1a34a849 )
  646.  
  647.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  648.     ROM_LOAD( "c10",          0x0000, 0x2000, 0x3dc1a6ff )
  649.     ROM_LOAD( "c09",          0x2000, 0x2000, 0x9b525c3e )
  650.  
  651.     ROM_REGION( 0x08000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  652.     ROM_LOAD( "c26",          0x00000, 0x2000, 0xa6897eac )
  653.     ROM_LOAD( "330e24.bin",   0x02000, 0x2000, 0xf9bbfe1d )
  654.     ROM_LOAD( "c22",          0x04000, 0x2000, 0xed9271a0 )
  655.     ROM_LOAD( "330e20.bin",   0x06000, 0x2000, 0x29969b92 )
  656.  
  657.     ROM_REGION( 0x10000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  658.     ROM_LOAD( "c14",          0x00000, 0x2000, 0xc72d63be )
  659.     ROM_LOAD( "c13",          0x02000, 0x2000, 0x76565608 )
  660.     ROM_LOAD( "c12",          0x04000, 0x2000, 0x74d2cc69 )
  661.     ROM_LOAD( "c11",          0x06000, 0x2000, 0x66cbcb4d )
  662.     ROM_LOAD( "c18",          0x08000, 0x2000, 0xed25e669 )
  663.     ROM_LOAD( "c17",          0x0a000, 0x2000, 0xb145b39f )
  664.     ROM_LOAD( "c16",          0x0c000, 0x2000, 0xd7ff9f2b )
  665.     ROM_LOAD( "c15",          0x0e000, 0x2000, 0xf3d454e6 )
  666.  
  667.     ROM_REGION( 0x0220, REGION_PROMS )
  668.     ROM_LOAD( "c03_c27.bin",  0x0000, 0x0020, 0xbc8a5956 )
  669.     ROM_LOAD( "j12_c28.bin",  0x0020, 0x0100, 0x2c891d59 )
  670.     ROM_LOAD( "a09_c29.bin",  0x0120, 0x0100, 0x811a3f3f )
  671.  
  672.     ROM_REGION( 0x10000, REGION_SOUND1 )    /*  64k for speech rom    */
  673.     ROM_LOAD( "c08",          0x0000, 0x2000, 0xe8f8ea78 )
  674. ROM_END
  675.  
  676. ROM_START( roadf )
  677.     ROM_REGION( 2*0x10000, REGION_CPU1 )     /* 64k for code + 64k for decrypted opcodes */
  678.     ROM_LOAD( "g05_g01.bin",  0x4000, 0x2000, 0xe2492a06 )
  679.     ROM_LOAD( "g07_f02.bin",  0x6000, 0x2000, 0x0bf75165 )
  680.     ROM_LOAD( "g09_g03.bin",  0x8000, 0x2000, 0xdde401f8 )
  681.     ROM_LOAD( "g11_f04.bin",  0xA000, 0x2000, 0xb1283c77 )
  682.     ROM_LOAD( "g13_f05.bin",  0xC000, 0x2000, 0x0ad4d796 )
  683.     ROM_LOAD( "g15_f06.bin",  0xE000, 0x2000, 0xfa42e0ed )
  684.  
  685.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  686.     ROM_LOAD( "a17_d10.bin",  0x0000, 0x2000, 0xc33c927e )
  687.  
  688.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  689.     ROM_LOAD( "a14_e26.bin",  0x00000, 0x4000, 0xf5c738e2 )
  690.     ROM_LOAD( "a12_d24.bin",  0x04000, 0x2000, 0x2d82c930 )
  691.     ROM_LOAD( "c14_e22.bin",  0x06000, 0x4000, 0xfbcfbeb9 )
  692.     ROM_LOAD( "c12_d20.bin",  0x0a000, 0x2000, 0x5e0cf994 )
  693.  
  694.     ROM_REGION( 0x08000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  695.     ROM_LOAD( "j19_e14.bin",  0x00000, 0x4000, 0x16d2bcff )
  696.     ROM_LOAD( "g19_e18.bin",  0x04000, 0x4000, 0x490685ff )
  697.  
  698.     ROM_REGION( 0x0220, REGION_PROMS )
  699.     ROM_LOAD( "c03_c27.bin",  0x0000, 0x0020, 0x45d5e352 )
  700.     ROM_LOAD( "j12_c28.bin",  0x0020, 0x0100, 0x2955e01f )
  701.     ROM_LOAD( "a09_c29.bin",  0x0120, 0x0100, 0x5b3b5f2a )
  702. ROM_END
  703.  
  704. ROM_START( roadf2 )
  705.     ROM_REGION( 0x10000, REGION_CPU1 )     /* 64k for code */
  706.     ROM_LOAD( "5g",           0x4000, 0x2000, 0xd8070d30 )
  707.     ROM_LOAD( "6g",           0x6000, 0x2000, 0x8b661672 )
  708.     ROM_LOAD( "8g",           0x8000, 0x2000, 0x714929e8 )
  709.     ROM_LOAD( "11g",          0xA000, 0x2000, 0x0f2c6b94 )
  710.     ROM_LOAD( "g13_f05.bin",  0xC000, 0x2000, 0x0ad4d796 )
  711.     ROM_LOAD( "g15_f06.bin",  0xE000, 0x2000, 0xfa42e0ed )
  712.  
  713.     ROM_REGION( 0x10000, REGION_CPU2 )    /* 64k for the audio CPU */
  714.     ROM_LOAD( "a17_d10.bin",  0x0000, 0x2000, 0xc33c927e )
  715.  
  716.     ROM_REGION( 0x0c000, REGION_GFX1 | REGIONFLAG_DISPOSE )
  717.     ROM_LOAD( "a14_e26.bin",  0x00000, 0x4000, 0xf5c738e2 )
  718.     ROM_LOAD( "a12_d24.bin",  0x04000, 0x2000, 0x2d82c930 )
  719.     ROM_LOAD( "c14_e22.bin",  0x06000, 0x4000, 0xfbcfbeb9 )
  720.     ROM_LOAD( "c12_d20.bin",  0x0a000, 0x2000, 0x5e0cf994 )
  721.  
  722.     ROM_REGION( 0x08000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  723.     ROM_LOAD( "j19_e14.bin",  0x00000, 0x4000, 0x16d2bcff )
  724.     ROM_LOAD( "g19_e18.bin",  0x04000, 0x4000, 0x490685ff )
  725.  
  726.     ROM_REGION( 0x0220, REGION_PROMS )
  727.     ROM_LOAD( "c03_c27.bin",  0x0000, 0x0020, 0x45d5e352 )
  728.     ROM_LOAD( "j12_c28.bin",  0x0020, 0x0100, 0x2955e01f )
  729.     ROM_LOAD( "a09_c29.bin",  0x0120, 0x0100, 0x5b3b5f2a )
  730. ROM_END
  731.  
  732.  
  733. static void init_hyperspt(void)
  734. {
  735.     konami1_decode();
  736. }
  737.  
  738.  
  739. GAME( 1984, hyperspt, 0,        hyperspt, hyperspt, hyperspt, ROT0,  "Konami (Centuri license)", "Hyper Sports" )
  740. GAME( 1984, hpolym84, hyperspt, hyperspt, hyperspt, hyperspt, ROT0,  "Konami", "Hyper Olympics '84" )
  741. GAME( 1984, roadf,    0,        roadf,    roadf,    hyperspt, ROT90, "Konami", "Road Fighter (set 1)" )
  742. GAME( 1984, roadf2,   roadf,    roadf,    roadf,    hyperspt, ROT90, "Konami", "Road Fighter (set 2)" )
  743.